let reg_v = new Vue({
    el:".registration-formcont",
    data:{
        inname:"",
        inpass:"",
        inpass2:"",
        innick:""
    },
    methods:{
        toname:function () {
            let data = new FormData(document.querySelector(".registration-formcont"));
            axios.post("/check",data).then(function (response) {
                reg_v.inname = response.data;
            })
        },
       /* topass1:function () {
            if(document.getElementsByName("password").length<6){
                reg_v.inpass = "密码小于6位";
            }else {
                reg_v.inpass = "密码可用";
            }
        },
        topass2:function () {
            if (document.getElementsByName("password").value==document.getElementsByName("password2").value) {
                reg_v.inpass = "密码正确";
            }else {
                reg_v.inpass = "密码错误";
            }
        },
        tonick:function () {
            if(document.getElementsByName(nickname).length==0){
                reg_v.innick = "昵称为空";
            }else {
                reg_v.innick = "昵称可用";
            }
        },
        reg:function () {
            if (document.getElementById("regisPass").value!=document.getElementById("regisrePass").value){
                reg_v.inpass="密码错误";
        }else{
                let data = new FormData(document.querySelector(".registration-formcont"));
                axios.post("/reg",data).then(function (response) {
                    if (response.data==0){
                        alert("注册");
                        location.href="/";
                    }else if (response.data==1){
                        alert("格式错误");
                    }else if (response.data==2){
                        alert("格式错误");
                    }else {
                        alert("用户已存在");
                    }
                })
            }

        }*/
    }
})